Skip to content

Conversation

@Manishearth
Copy link
Member

Depends on #7115, depends on #7105

Attempt at fixing #7104.

The user experience of the byte slice is a little bit worse if you want to use MonthCode::new_normal/new_leap since you have to persist those for a while.

Most people will not be creating them for long, though. In theory we could produce byte versions of those methods that produce a limited range of codes. It's more a problem for our tests that need to do things like "create many codes in a loop".

Copy link
Member

@sffc sffc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems good. You only need to do funny number stuff in a few test files which is fine; they don't reflect how real people will be using this.

@Manishearth
Copy link
Member Author

That was my conclusion too.

It's a bit of a bummer to lose the readability of the old new_normal, new_leap APIs though

@Manishearth
Copy link
Member Author

I'm overall quite convinced by the "from_fields should accept anything" argument so even if we had ValidMonthCode already designed and graduated I would not want to use it here anyway.

@Manishearth
Copy link
Member Author

Also note: this PR doesn't yet fix the Debug impl but it's an easy addition I'll do soon.

@Manishearth
Copy link
Member Author

(undid the force push, the new Debug commit is the only new thing)

@Manishearth Manishearth force-pushed the month-bytes branch 2 times, most recently from c2b2dba to a3d99e0 Compare October 20, 2025 19:22
@dpulls
Copy link

dpulls bot commented Oct 20, 2025

🎉 All dependencies have been resolved !

@Manishearth Manishearth merged commit b863778 into unicode-org:main Oct 20, 2025
30 checks passed
@Manishearth Manishearth deleted the month-bytes branch October 20, 2025 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants